<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
require_once BASE_PATH.'application/controllers/base'.EXT;

class Rss extends Base {
	
       public function __construct()
       {
            parent::__construct();
	      $this->load->model("itemDAO");
       }
       
              
       public function index()
       {
	      
	      $items = $this->itemDAO->select(array("order"=>array("created","DESC"),"limit"=>array(0,20)));
	      
	      $data = array(
		     'titulo'      => SITE_NAME,
		     'feed_url'    => BASE_URL."rss",
		     'description' => '',
		     'posts'       => $items
		     );
	      header("Content-Type: application/rss+xml");
	      $this->load->view('feed',$data);
       }
}
?>